package com.wpen.unit.config;

import org.springdoc.core.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Description swagger配置
 * @author Wang Peng
 * @date 2022-12-06
 */
@Configuration
public class knife4jConfig {
    /**
     * 添加分组
     */
    @Bean
    public GroupedOpenApi publicApi() {
//               .pathMapping("/")
//                .apiInfo(apiInfo()).enable(true)
//                .enable(env.contains("dev") | env.contains("test") | env.contains("local"))
//                .groupName("WMS-2022接口")
//                .select()
//                .apis(RequestHandlerSelectors.basePackage("gr.wms.service.impl.control.controller"))
//                .paths(PathSelectors.any())
//                .build().globalOperationParameters(setHeaderToken());
        return GroupedOpenApi.builder()
                .group("dsp-job")
//                .pathsToExclude("/xxx")
                .packagesToScan("com.wpen.dsp")
                .build();
    }
}